import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';

export const columns: BasicColumn[] = [
  { title: '名称', dataIndex: 'name', width: 110,},
  { title: '项目', dataIndex: 'itemIds', align: 'left', slots: { customRender: 'itemIds' }, },
];

export const formSchema: FormSchema[] = [
  { label: "", field: "id", component: "Input", show: false },
  { label: "", field: "tenantId", component: "Input", show: false },
  { label: "名称", field: "name", component: "Input", componentProps: { placeholder: " ", autoComplete:"off" } },
  { label: "类型", field: "type", component: "Select", required: true,
    componentProps: ({ formActionType }) => {
      return {
        options: [
          { label: '银行', value: '1' },
          { label: '部门', value: '2' },
        ],
        getPopupContainer: () => document.body,
      }
    },
    defaultValue: '1'
  },
  {
    label: "银行",
    field: "bankTenantIds",
    component: "JDictSelectTag",
    componentProps: {
      mode: "multiple",
      dictCode: "chee_bank,djm,id",
      placeholder: " ",
      StringToNumber: true,
      getPopupContainer: () => document.body,
    },
    ifShow: ({ model }) => {
      return model.type == '1';
    },
    required: true
  },
  {
    label: "部门",
    field: "ddlxTenantIds",
    component: "JDictSelectTag",
    componentProps: {
      mode: "multiple",
      dictCode: "ddlxType",
      placeholder: " ",
      getPopupContainer: () => document.body,
    },
    ifShow: ({ model }) => {
      return model.type == '2';
    },
    required: true
  },
];